﻿using System;

namespace CS.Http
{
    /// <summary>
    /// 消息事件参数
    /// </summary>
    public class MessageEventArgs : EventArgs
    {
        /// <summary>
        /// Info类型消息初始化
        /// </summary>
        /// <param name="msg"></param>
        public MessageEventArgs(string msg):this(MessageType.Info,msg)
        {

        }

        /// <summary>
        /// 消息初始化
        /// </summary>
        /// <param name="type">消息类型</param>
        /// <param name="msg"></param>
        public MessageEventArgs(MessageType type,string msg)
        {
            Type = type;
            Message = msg;
        }
       

        public string Message { get; private set; }

        public MessageType Type { get; private set; }

    }

    /// <summary>
    /// 消息类型
    /// </summary>
    public enum MessageType
    {
        /// <summary>
        /// 一般性消息
        /// </summary>
        Info,
        /// <summary>
        /// 警告
        /// </summary>
        Warn,
        /// <summary>
        /// 错误
        /// </summary>
        Error,
        /// <summary>
        /// 异常
        /// </summary>
        Exception,
        /// <summary>
        /// 系统
        /// </summary>
        System,

    }

}